<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
DRA Systems: OR-Objects 1.2.4: Class  MatrixGraph
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../drasys/or/graph/Graph.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../drasys/or/graph/Operations.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MatrixGraph.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_drasys.or.graph.Graph">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
drasys.or.graph</FONT>
<BR>
Class  MatrixGraph</H2>
<PRE>
java.lang.Object
  |
  +--<A HREF="../../../drasys/or/graph/Graph.html">drasys.or.graph.Graph</A>
        |
        +--<B>drasys.or.graph.MatrixGraph</B>
</PRE>
<HR>
<DL>
<DT>public class <B>MatrixGraph</B><DT>extends <A HREF="../../../drasys/or/graph/Graph.html">Graph</A><DT>implements <A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A></DL>

<P>
This graph is essentially a dense matrix of double values inside a GraphI wrapper.
The origin vertices are associated with the rows and the destination vertices are associated with the columns.
A matrix element value of Double.POSITIVE_INFINITY represents a missing edge.
A missing edge will cause 'getEdge()' to return null and will not be counted in the degree of any vertex.
<BR>
The edge method 'doubleValue()' returns the double value from the matrix that corresponds to the edge. 
The edge method 'getValue()' returns a new instance of 'Double' containing the value.
<BR>
The vertex method 'doubleValue()' returns a double value based on the vertex value object.
If the value object is not null and either implements 'DoubleI' or is a subclass of 'Number' 
then the value is 'value.doubleValue()'.
Otherwise; the value is zero.
<P><FONT COLOR="#CC0000"><FONT SIZE=+1>References:</FONT></FONT><FONT SIZE=+1></FONT><P><B><A NAME="0471513563"HREF="http://www.amazon.com/exec/obidos/ISBN=0471513563/opsresearchcomA/" TARGET="amazon.com">Graphs : Theory and Algorithms</A></B><BR>&nbsp;&nbsp;&nbsp;&nbsp;K. Thulasiraman, M.N.S. Swamy / Paperback / Published 1992<BR>
<P>
<DL>
<DT><B>See Also: </B><DD><A HREF="../../../serialized-form.html#drasys.or.graph.MatrixGraph">Serialized Form</A></DL>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="fields_inherited_from_class_drasys.or.graph.Graph"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class drasys.or.graph.<A HREF="../../../drasys/or/graph/Graph.html">Graph</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../drasys/or/graph/Graph.html#_symmetric">_symmetric</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#MatrixGraph(drasys.or.graph.GraphI, java.lang.Object)">MatrixGraph</A></B>(<A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A>&nbsp;graph,
            java.lang.Object&nbsp;edgeKey)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the graph from another graph.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#MatrixGraph(drasys.or.graph.GraphI, java.lang.Object, drasys.or.graph.EdgePropertiesI)">MatrixGraph</A></B>(<A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A>&nbsp;graph,
            java.lang.Object&nbsp;edgeKey,
            <A HREF="../../../drasys/or/graph/EdgePropertiesI.html">EdgePropertiesI</A>&nbsp;properties)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the graph from another graph.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#MatrixGraph(drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI)">MatrixGraph</A></B>(<A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;cost,
            <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;time,
            <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;distance)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the graph from the values in 'matrix', the matrix must be square.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#MatrixGraph(drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, java.util.Vector)">MatrixGraph</A></B>(<A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;cost,
            <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;time,
            <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;distance,
            java.util.Vector&nbsp;vertexKeys)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the graph from the values in 'matrix', the matrix must be square.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#MatrixGraph(drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, java.util.Vector, java.util.Vector)">MatrixGraph</A></B>(<A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;cost,
            <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;time,
            <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;distance,
            java.util.Vector&nbsp;vertexKeys,
            java.util.Vector&nbsp;vertexValues)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the graph from the values in 'matrix', the matrix must be square.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#MatrixGraph(drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, drasys.or.graph.VertexI[], drasys.or.graph.VertexI[])">MatrixGraph</A></B>(<A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;cost,
            <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;time,
            <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;distance,
            <A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>[]&nbsp;fromVertices,
            <A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>[]&nbsp;toVertices)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the graph from the values in 'matrix', the matrix can be any rectangular shape.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#getChangeCount()">getChangeCount</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Always returns zero since this graph is immutable.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../drasys/or/graph/EdgeI.html">EdgeI</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#getEdge(drasys.or.graph.VertexI, drasys.or.graph.VertexI, java.lang.Object)">getEdge</A></B>(<A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>&nbsp;from,
        <A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>&nbsp;to,
        java.lang.Object&nbsp;edgeKey)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the edge between the from and to vertices, the edge key must be null for a match.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../drasys/or/graph/EdgeI.html">EdgeI</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#getMutableEdge(drasys.or.graph.VertexI, drasys.or.graph.VertexI, java.lang.Object)">getMutableEdge</A></B>(<A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>&nbsp;from,
               <A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>&nbsp;to,
               java.lang.Object&nbsp;edgeKey)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the edge between the from and to vertices, the edge key must be null for a match.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#getVertex(java.lang.Object)">getVertex</A></B>(java.lang.Object&nbsp;key)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the vertex that matches the key.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#isSymmetric()">isSymmetric</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns 'isSymmetric()' from the initialization matrix by default.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#sizeOfDirectedEdges()">sizeOfDirectedEdges</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#sizeOfEdges()">sizeOfEdges</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#sizeOfVertices()">sizeOfVertices</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Enumeration</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../drasys/or/graph/MatrixGraph.html#vertices()">vertices</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an enumeration on the vertices of the graph.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_drasys.or.graph.Graph"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class drasys.or.graph.<A HREF="../../../drasys/or/graph/Graph.html">Graph</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../drasys/or/graph/Graph.html#edges()">edges</A>, 
<A HREF="../../../drasys/or/graph/Graph.html#equals(java.lang.Object)">equals</A>, 
<A HREF="../../../drasys/or/graph/Graph.html#getEdge(drasys.or.graph.EdgeI)">getEdge</A>, 
<A HREF="../../../drasys/or/graph/Graph.html#getEdge(java.lang.Object, java.lang.Object, java.lang.Object)">getEdge</A>, 
<A HREF="../../../drasys/or/graph/Graph.html#isSubsetOf(drasys.or.graph.GraphI)">isSubsetOf</A>, 
<A HREF="../../../drasys/or/graph/Graph.html#mutableEdges()">mutableEdges</A>, 
<A HREF="../../../drasys/or/graph/Graph.html#setSymmetric(java.lang.Boolean)">setSymmetric</A>, 
<A HREF="../../../drasys/or/graph/Graph.html#toString(java.lang.String)">toString</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, 
finalize, 
getClass, 
hashCode, 
notify, 
notifyAll, 
toString, 
wait, 
wait, 
wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="MatrixGraph(drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI)"><!-- --></A><H3>
MatrixGraph</H3>
<PRE>
public <B>MatrixGraph</B>(<A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;cost,
                   <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;time,
                   <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;distance)</PRE>
<DL>
<DD>Initializes the graph from the values in 'matrix', the matrix must be square.
The vertex keys will be an Integer object equal to the row/column index and the vertex values will be null.
The edges will be directed and the matrix row corresponds to the from vertex of the edge.
The set of 'from' vertices and the set of 'to' vertices will be equivalent.</DL>
<HR>

<A NAME="MatrixGraph(drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, java.util.Vector)"><!-- --></A><H3>
MatrixGraph</H3>
<PRE>
public <B>MatrixGraph</B>(<A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;cost,
                   <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;time,
                   <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;distance,
                   java.util.Vector&nbsp;vertexKeys)
            throws <A HREF="../../../drasys/or/graph/DuplicateVertexException.html">DuplicateVertexException</A></PRE>
<DL>
<DD>Initializes the graph from the values in 'matrix', the matrix must be square.
The vertex keys will be set to the elements of 'vertexKeys' and the vertex values will be null.
The edges will be directed and the matrix row corresponds to the from vertex of the edge.
The set of 'from' vertices and the set of 'to' vertices will be equivalent.</DL>
<HR>

<A NAME="MatrixGraph(drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, java.util.Vector, java.util.Vector)"><!-- --></A><H3>
MatrixGraph</H3>
<PRE>
public <B>MatrixGraph</B>(<A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;cost,
                   <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;time,
                   <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;distance,
                   java.util.Vector&nbsp;vertexKeys,
                   java.util.Vector&nbsp;vertexValues)
            throws <A HREF="../../../drasys/or/graph/DuplicateVertexException.html">DuplicateVertexException</A></PRE>
<DL>
<DD>Initializes the graph from the values in 'matrix', the matrix must be square.
The vertex keys will be set to the elements of 'vertexKeys' and the vertex values will be set to the elements of 'vertexValues'.
The edges will be directed and the matrix row corresponds to the from vertex of the edge.
The set of 'from' vertices and the set of 'to' vertices will be equivalent.</DL>
<HR>

<A NAME="MatrixGraph(drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, drasys.or.matrix.MatrixI, drasys.or.graph.VertexI[], drasys.or.graph.VertexI[])"><!-- --></A><H3>
MatrixGraph</H3>
<PRE>
public <B>MatrixGraph</B>(<A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;cost,
                   <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;time,
                   <A HREF="../../../drasys/or/matrix/MatrixI.html">MatrixI</A>&nbsp;distance,
                   <A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>[]&nbsp;fromVertices,
                   <A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>[]&nbsp;toVertices)
            throws <A HREF="../../../drasys/or/graph/ParallelEdgeException.html">ParallelEdgeException</A></PRE>
<DL>
<DD>Initializes the graph from the values in 'matrix', the matrix can be any rectangular shape.
The the origin vertices will be set from 'fromVertices' and must have the same 
number of elements as there are rows in the matrix.
The the destination vertices will be set from 'toVertices' and must have the same
number of elements as there are columns in the matrix.
The same vertex can appear in both the 'fromVertices' and 'toVertices' arrays.
The edges will be directed and the matrix row corresponds to the from vertex of the edge.
The set of 'from' vertices and the set of 'to' vertices can be different.
The from keys correspond to the rows and the to keys correspond to the columns.</DL>
<HR>

<A NAME="MatrixGraph(drasys.or.graph.GraphI, java.lang.Object)"><!-- --></A><H3>
MatrixGraph</H3>
<PRE>
public <B>MatrixGraph</B>(<A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A>&nbsp;graph,
                   java.lang.Object&nbsp;edgeKey)</PRE>
<DL>
<DD>Initializes the graph from another graph.
The new graph will contain all the vertices from the original and the value matrix will be square.
The matrix elements will be initialized from the 'doubleValue()' method of the edges with matching keys.
The value of missing edges will be set to Double.POSITIVE_INFINITY.
The double value of undirected edges will be placed in two entries in the value matrix.</DL>
<HR>

<A NAME="MatrixGraph(drasys.or.graph.GraphI, java.lang.Object, drasys.or.graph.EdgePropertiesI)"><!-- --></A><H3>
MatrixGraph</H3>
<PRE>
public <B>MatrixGraph</B>(<A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A>&nbsp;graph,
                   java.lang.Object&nbsp;edgeKey,
                   <A HREF="../../../drasys/or/graph/EdgePropertiesI.html">EdgePropertiesI</A>&nbsp;properties)</PRE>
<DL>
<DD>Initializes the graph from another graph.
The new graph will contain all the vertices from the original and the value matrix will be square.
The matrix elements will be initialized from the 'getEdgeCost()' method in the properties object.
The value of missing edges will be set to Double.POSITIVE_INFINITY.
Undirected edges will cause two calls to 'getEdgeCost()', one for each element position.
If 'isEdgeRestricted()' returns true, the corresponding matrix element will be set to Double.POSITIVE_INFINITY.</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="getChangeCount()"><!-- --></A><H3>
getChangeCount</H3>
<PRE>
public int <B>getChangeCount</B>()</PRE>
<DL>
<DD>Always returns zero since this graph is immutable.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../drasys/or/graph/GraphI.html#getChangeCount()">getChangeCount</A> in interface <A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A></DL>
</DD>
</DL>
<HR>

<A NAME="sizeOfVertices()"><!-- --></A><H3>
sizeOfVertices</H3>
<PRE>
public int <B>sizeOfVertices</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../drasys/or/graph/GraphI.html#sizeOfVertices()">sizeOfVertices</A> in interface <A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The number vertices in the graph.</DL>
</DD>
</DL>
<HR>

<A NAME="sizeOfEdges()"><!-- --></A><H3>
sizeOfEdges</H3>
<PRE>
public int <B>sizeOfEdges</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../drasys/or/graph/GraphI.html#sizeOfEdges()">sizeOfEdges</A> in interface <A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The number edges in the graph.</DL>
</DD>
</DL>
<HR>

<A NAME="sizeOfDirectedEdges()"><!-- --></A><H3>
sizeOfDirectedEdges</H3>
<PRE>
public int <B>sizeOfDirectedEdges</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../drasys/or/graph/GraphI.html#sizeOfDirectedEdges()">sizeOfDirectedEdges</A> in interface <A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The number of directed edges in the graph.</DL>
</DD>
</DL>
<HR>

<A NAME="isSymmetric()"><!-- --></A><H3>
isSymmetric</H3>
<PRE>
public boolean <B>isSymmetric</B>()</PRE>
<DL>
<DD>Returns 'isSymmetric()' from the initialization matrix by default. 
If 'setSymmetric' has been called, then the override value is returned.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../drasys/or/graph/GraphI.html#isSymmetric()">isSymmetric</A> in interface <A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A></DL>
</DD>
</DL>
<HR>

<A NAME="getMutableEdge(drasys.or.graph.VertexI, drasys.or.graph.VertexI, java.lang.Object)"><!-- --></A><H3>
getMutableEdge</H3>
<PRE>
public <A HREF="../../../drasys/or/graph/EdgeI.html">EdgeI</A> <B>getMutableEdge</B>(<A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>&nbsp;from,
                            <A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>&nbsp;to,
                            java.lang.Object&nbsp;edgeKey)</PRE>
<DL>
<DD>Get the edge between the from and to vertices, the edge key must be null for a match.
The graph is allowed to return a mutable edge if that is more efficient, 
but the edge contents must be used before 'getMutableEdge()' is called again.
The arguments 'from' and 'to' must be vertices from this graph.
The argument 'edgeKey' is not used.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../drasys/or/graph/GraphI.html#getMutableEdge(drasys.or.graph.VertexI, drasys.or.graph.VertexI, java.lang.Object)">getMutableEdge</A> in interface <A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>Null if the edge is not in the graph.</DL>
</DD>
</DL>
<HR>

<A NAME="vertices()"><!-- --></A><H3>
vertices</H3>
<PRE>
public java.util.Enumeration <B>vertices</B>()</PRE>
<DL>
<DD>Creates an enumeration on the vertices of the graph.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../drasys/or/graph/GraphI.html#vertices()">vertices</A> in interface <A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>An enumeration with elements of class VertexI.</DL>
</DD>
</DL>
<HR>

<A NAME="getVertex(java.lang.Object)"><!-- --></A><H3>
getVertex</H3>
<PRE>
public <A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A> <B>getVertex</B>(java.lang.Object&nbsp;key)</PRE>
<DL>
<DD>Get the vertex that matches the key.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../drasys/or/graph/GraphI.html#getVertex(java.lang.Object)">getVertex</A> in interface <A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>Null if the edge is not in the graph.</DL>
</DD>
</DL>
<HR>

<A NAME="getEdge(drasys.or.graph.VertexI, drasys.or.graph.VertexI, java.lang.Object)"><!-- --></A><H3>
getEdge</H3>
<PRE>
public <A HREF="../../../drasys/or/graph/EdgeI.html">EdgeI</A> <B>getEdge</B>(<A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>&nbsp;from,
                     <A HREF="../../../drasys/or/graph/VertexI.html">VertexI</A>&nbsp;to,
                     java.lang.Object&nbsp;edgeKey)</PRE>
<DL>
<DD>Get the edge between the from and to vertices, the edge key must be null for a match.
The arguments 'from' and 'to' must be vertices from this graph.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../drasys/or/graph/GraphI.html#getEdge(drasys.or.graph.VertexI, drasys.or.graph.VertexI, java.lang.Object)">getEdge</A> in interface <A HREF="../../../drasys/or/graph/GraphI.html">GraphI</A></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>Null if the edge is not in the graph.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../drasys/or/graph/Graph.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../drasys/or/graph/Operations.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MatrixGraph.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_drasys.or.graph.Graph">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
Copyright(C)1997-2000 by DRA Systems all rights reserved. <A HREF=http://OpsResearch.com TARGET=HOME>OpsResearch.com</A>
</BODY>
</HTML>
